package com.kqzz.common.config.xss;

import java.io.IOException;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.filter.OncePerRequestFilter;

public class XssHttpServletFilter extends OncePerRequestFilter{

	@Override
	protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		String url = request.getRequestURI();
		if(url.startsWith("/thirdLogin")){ // 忽略微信认证的请求，直接进入下个过滤器
			chain.doFilter(request, response);
		}else{
			chain.doFilter(new XssHtmlSqlHttpServletRequestWrapper(request), response);
		}
	}
}